Draws a filled rectangle on the screen.
x1,y1
The coordinates of one corner of the rectangle.
x2,y2
The coordinates of the opposite corner of the rectangle.
windowSIZE 640 480 8
drawCLEAR red ;paint the screen red
color white ;set drawing color to white
drawRECT 5,12 100,80 ;draw a rectangle
;performing a gradient fill:
if @desktopBITS<=8 ;requires HiColor or TrueColor windowSIZE mode
exitnow
endif
windowSIZE 640 480 24
drawCLEAR white
set range 1+@drawMAXX-@minx
mark @minx @drawMAXX
set red 255-((@loop-@minx)*255)/@range
color @red @red 255
drawRECT @minx @loop @drawMAXX @loop
endloop
wait
Rectangles are drawn in the current drawing color, which is set with the COLOR command.
drawRECT will not draw outside the current drawREGION.
Rectangle coordinates are affected by the drawOFFSET command.
Using SET drawAND ON, set drawOR ON or set drawXOR ON causes pixel colors to be affected by the background color.
Use the drawRECTROUND command to draw rounded-edge rectangles.